package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.common.pojo.pay.dtos.OrderQueryDTO;
import com.zhentao.model.common.pojo.pay.dtos.PayDto;
import com.zhentao.service.IChargePayOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class ChargePayOrderController {
    @Autowired
    private IChargePayOrderService chargePayOrderService;



    @PostMapping("/pay/prepay/test")
    /**
     * @description:生成订单
     * @author: muhaoyang
     * @date: 2025/1/5 18:27
     * @param: [payDto]
     * @return: com.zhentao.model.common.dtos.ResponseResult
     **/
    public ResponseResult perpayTest(@RequestBody PayDto payDto) {
        return this.chargePayOrderService.perpayTest(payDto);
    }

    @PostMapping("/payment/order/query")
    /**
     * @description:查询支付集合
     * @author: muhaoyang
     * @date: 2025/1/5 18:28
     * @param: [orderQueryDTO]
     * @return: com.zhentao.model.common.dtos.ResponseResult
     **/
    public ResponseResult OrderQuery(@RequestBody OrderQueryDTO orderQueryDTO){
        return this.chargePayOrderService.OrderQuery(orderQueryDTO);
    }
}